package com.snmp.smn.monitors;

import java.io.FileOutputStream;
import java.util.Properties;

public class ShutdownMonitor extends Thread {
	
	private Properties props;
	
	private String agentConfig;

	public ShutdownMonitor(Properties props, String agentConfig) throws Exception {
		this.props = props;
		this.agentConfig = agentConfig;
		
		this.props.setProperty("status", "Running");
		this.props.storeToXML(new FileOutputStream(this.agentConfig), "");
	}
	
	public void run() {
		try {
			props.setProperty("status", "Shutdown");
			props.storeToXML(new FileOutputStream(agentConfig), "");
		} catch (Exception e) {

		}
	}
}
